﻿<%@ Page Title="" Language="C#" MasterPageFile="~/PortalParts/PageMorePartyRepresentative.Master" AutoEventWireup="true" CodeBehind="Meeting.aspx.cs" Inherits="ZHDJ.Web.Portal.PartyRepresentative.Meeting" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="../../Resource/js/default/jquery.tmpl.min.js"></script>
    <script src="../../Resource/js/knockout/knockout-3.4.0.js"></script>
    <script src="../../Resource/js/jquery/jquery.pagination.js"></script>
    <script>
        var pageSize = 10, isBind = false;

        var paginationPara = {
            num_edge_entries: 1, //边缘页数
            num_display_entries: 4, //主体页数
            callback: pageselectCallback,
            items_per_page: pageSize, //每页显示1项
            prev_text: "上一页",
            next_text: "下一页",
            link_to: "javascript:void(0);"
        }
        var ViewModel = {
            qdate: ko.observableArray(),
            loadContacts: function (pageIndex) {
                $.get("Meeting.aspx", {
                    PageIndex: pageIndex ,
                    PageSize: pageSize,
                    StudioID: $("#ctl00_ContentPlaceHolder1_hdStudioID").val(),
                    r: (new Date()).getTime()
                },
                function (data) {
                    var ss = eval("(" + data + ")");

                    ViewModel.qdate(eval("(" + data + ")"));
                });
            }
        }

        function initPage() {
            $.get("Meeting.aspx", { DataCount: 1, StudioID: $("#ctl00_ContentPlaceHolder1_hdStudioID").val(), r: (new Date()).getTime() },
                function (data) {
                    var totalCount = parseInt(data);
                    if (totalCount == 0) {
                        $("#trnonedata").show();
                    }
                    $("#pagination").pagination(totalCount, paginationPara);
                });
        }
        function pageselectCallback(pageIndex, jq) {
            ViewModel.loadContacts(pageIndex);
            if (!isBind) {
                ko.applyBindings(ViewModel);
                isBind = true;
            }

        }
        $(function () {
            initPage();
        });



    </script>
    <script id="myTemplate" type="text/x-jquery-tmpl">
        <tr class="tr_a">
            <td class="td1"><a href="MeetingDetail.aspx?id=${ID}" target="_blank">${Title2}</a></td>
            <td class="td2">${BeginTime2}</td>
        </tr>
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:HiddenField ID="hdStudioID" runat="server" />
    <div>
        <div class="cztable" style="margin-top: 20px;">
            <table class="table_b" border="0" cellspacing="0" cellpadding="0">
                <tr class="tr_b">
                    <td class="tdbar" colspan="2">
                        <h5>本周接访</h5>
                    </td>
                </tr>
                <%= LoadWeekHmtl() %>
            </table>
        </div>

        <div class="cztable" style="margin-top: 20px;">
            <table class="table_a" border="0" cellspacing="0" cellpadding="0">

                <tr class="tr_b ">
                    <td class="tdbar" colspan="2">
                        <h5>接访排期</h5>
                    </td>
                </tr>
                <!-- ko template: { name: 'myTemplate', foreach: qdate} -->
                <!-- /ko -->
                <tr style="display: none" id="trnonedata" class="tr_a">
                    <td class="td2" style="text-align: center" colspan="4">无数据</td>
                </tr>
            </table>
            <div class="pagination">
                <div id="pagination">
                </div>
            </div>
        </div>
    </div>
</asp:Content>
